<html>
<head></head>
<!--
This page has four images to test the various values for crossorigin attribute.
-->
<img/>
<img crossorigin="anonymous"/>
<img crossorigin="use-credentials"/>
<img crossorigin=""/>
<script src="common.js"></script>
<script>
function checkAllImagesLoaded() {
  return new Promise((resolve, reject) => {
    Promise.all([
      imageLoadedPromise(document.images[0]),
      imageLoadedPromise(document.images[1]),
      imageLoadedPromise(document.images[2]),
      imageLoadedPromise(document.images[3])
    ]).then(() => {
        resolve(true);
    });
  });
}

window.onload = () => {
  setTimeout(() => {
    document.images[0].src = "image.png?nocrossorgin"
    document.images[1].src = "image.png?crossorigin-anonymous"
    document.images[2].src = "image.png?crossorigin-use-credentials"
    document.images[3].src = "image.png?crossorigin-empty"
  }, 1000)
}
</script>
</html>
